
var ok1 = false;//用户登录状态变量
var ok2 = false;//密码状态
var ok3 = false;//手机状态

//	密码验证函数
	function passwo(inputName,msgName ){
		var pass = $(inputName).val();
		
		if(pass == ""){
			$(msgName).show().html("密码不能为空");
			ok2 = false;
			
		}
		else if(pass.length < 6 || pass.length > 20){
			$(msgName).show().html("密码长度为6-20位");
			ok2 = false;
			
			
		}
		else if(!/^[a-zA-Z0-9][a-zA-Z0-9]{5,19}/.test(pass)){
			$(msgName).show().html("密码格式有误");
		}
		else{
			$(msgName).show().html("");
			ok2 = true;
		}
	}	
//	用户名验证函数	
	function username(inputName,msgName){
		
		var nameform = $(inputName).val();
		
		if( nameform == ""){
			$(msgName).show().html("用户名不能为空");
			ok1 = false;
			
		}
	
		//验证用户名是否大于六位
		else if( nameform.length < 3 || nameform.length > 20){
			$(msgName).show().html("字符长度为6到20");
			ok1 = false;
		}
	
		//验证用户名格式是否正确
	
		else if(!/[a-zA-Z0-9]{3,20}/.test(nameform)){
				$(msgName).show().html("由字母、数字、下划线组成");
				ok1 = false;
			}
	
		else{
			$(msgName).html("");
			ok1 = true;
		}
		
	}
//	手机号输入验证函数
	function phoneName1(inputName,msgName){
		var nameform = $(inputName).val();
		if( nameform == ""){
			
			$(msgName).show().html("手机号不能为空");
			ok3 = false;
		}
	
		else if(!/^1[34578]\d{9}$/.test(nameform)){
			
				$(msgName).show().html("手机号码有误");
				ok3 = false;
			}
	
		else{
			
			$(msgName).html("");
			
			ok3 = true;
			
		}
		
	}
	
	
	
//	用于截取href中的相关有用信息;
	function getUrl(){
		var url = window.location.search;
		var arr = [];
		var newArr = []
		arr = url.substring(1).split("&");
		for(var i = 0; i < arr.length; i++){
			newArr.push(arr[i].split("=")[1])
		}
		
		return newArr;
	}
	
	
//	用于去除遮罩层
	$("#warning .firstP .iconfont").click(function(){
		alert(1);
		$("#warning").hide();
		$("#shadow").hide();
	})
	
	
	
